package com.qingcheng.consumer;

import com.alibaba.dubbo.config.annotation.Service;
import com.qingcheng.service.order.OrderService;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.beans.factory.annotation.Autowired;


@Service
public class OrderMessageListener implements MessageListener {
    /**
     * 消息监听
     * @param message
     */
    @Autowired
    private OrderService orderService;
    @Override
    public void onMessage(Message message) {
        String s = new String(message.getBody());

        System.out.println("监听到的消息+++++"+s);
        orderService.chaoshiPay(s);
    }
}
